package org.wei.p2p.consumer.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.wei.p2p.api.consumer.ConsumerApi;
import org.wei.p2p.api.consumer.model.ConsumerRegisterDTO;
import org.wei.p2p.consumer.service.IConsumerService;

import javax.annotation.Resource;

/**
 * <p>
 * c端用户信息表 前端控制器.
 * </p>
 *
 * @author wei
 * @date 2022-04-24
 */
@RestController
@Tag(name = "CONSUMER",description = "c端用户服务")
public class ConsumerController implements ConsumerApi {

    @Resource
    private IConsumerService consumerService;


    @Override
    @Operation(description = "用户注册")
    @PostMapping(value = "/consumers")
    public void register(@RequestBody ConsumerRegisterDTO consumerRegisterDTO) {
        consumerService.register(consumerRegisterDTO);
    }
}
